package com.huatai.datacenter.controller.fire;

import com.huatai.datacenter.controller.fire.retention.ApiCheck;
import com.huatai.datacenter.entity.ApiEntity;
import com.huatai.datacenter.service.ApiService;
import com.huatai.dataservice.fire.feign.FireClient;
import com.huatai.dataservice.fire.firemodel.FireResponseVo;
import com.huatai.dataservice.fire.firemodel.ResponseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author gaowengui
 * 一张图实战指挥
 */
@RestController
@RequestMapping("/pc/api")
@Api(tags = "一张图实战指挥", value = "一张图实战指挥")
@Slf4j
public class PracticalCommandController {
	@Autowired
	private FireClient fireClient;

	@Autowired
	private ApiService apiService;
	/**
	 * @return
	 * @author gaowengui
	 * 获取警情影响位置类型分布
	 */
	@ApiOperation("获取警情影响位置类型分布")
	@GetMapping("/getAlertByClass")
	@ApiCheck
	public ResponseVo getAlertByClass() {
		return fireClient.getAlertByClass();
	}

	/**
	 * @return
	 * @author gaowengui
	 * 获取警情按时段分布数据
	 */
	@ApiOperation("获取警情按时段分布数据")
	@GetMapping("/getAlertByPeriod")
	@ApiCheck
	public ResponseVo getAlertByPeriod() {
		return fireClient.getAlertByPeriod();
	}

	/**
	 * @return
	 * @author gaowengui
	 * 获取警情出动分类分布
	 */
	@ApiOperation("获取警情出动分类分布")
	@GetMapping("/getAlertByDispatch")
	@ApiCheck
	public ResponseVo getAlertByDispatch() {
		return fireClient.getAlertByDispatch();

	}

	/**
	 * @return
	 * @author gaowengui
	 * 获取接警情况分布
	 */
	@ApiOperation("获取接警情况分布")
	@GetMapping("/getAlertByAcception")
	@ApiCheck
	public FireResponseVo getAlertByAcception() {
		return fireClient.getAlertByAcception();
	}

	/**
	 * @return
	 * @author gaowengui
	 * 获取队站情况数据
	 */
	@ApiOperation("获取队站情况数据")
	@GetMapping("/getTeamStaff")
	@ApiCheck
	public ResponseVo getTeamStaff() {
		return fireClient.getTeamStaff();
	}

	/**
	 * @return
	 * @author gaowengui
	 * 获取执勤车辆统计数据
	 */
	@ApiOperation("获取执勤车辆统计数据")
	@GetMapping("/getVehicleByTeam")
	@ApiCheck
	public ResponseVo getVehicleByTeam() {
		return fireClient.getVehicleByTeam();
	}

	/**
	 * @return
	 * @author gaowengui
	 */
	@ApiOperation(" 获取消防车类型数据")
	@GetMapping("/getXFCarByType")
	@ApiCheck
	public ResponseVo getXFCarByType() {
		return fireClient.getXFCarByType();
	}

	/**
	 * @return
	 * @author gaowengui
	 * 获取预案编制进度情况
	 */
	@ApiOperation("获取预案编制进度情况")
	@GetMapping("/getResProgress")
	@ApiCheck//自定义注解
	public ResponseVo getResProgress() {
//		String requestURI = request.getRequestURI();
//		String processedURI = requestURI.startsWith("/") ? requestURI.substring(1) : requestURI;
//		///StringBuffer requestURL = request.getRequestURL();
//		ApiEntity config = apiService.getConfig(processedURI);
//		if (config != null) {
//			return null;
//		}
		return fireClient.getResProgress();
	}

	@ApiOperation("获取水源情况")
	@GetMapping("/getWaterProgress")
	@ApiCheck
	public ResponseVo getWaterProgress() {
		return fireClient.getWaterProgress();
	}
}
